home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best of www.BestZips.com (Collector's Edition)
/
Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO
/
egames__
/
learn30.zip
/
RANDOM.DOC
< prev
next >
Wrap
Text File
|
1994-01-06
|
4KB
|
97 lines
-=Random=-
Version 1.1ß
(c) Copyright 1994
Jaben Cargman
BBS: (602) 282-3134
FidoNet: 1:114/304
Introduction:
A while back (before I could program) I used to love to
create batch files and even thought about designing some
program with them. But there was a lot of limitations, I had
to have 5 different program to accomplish one task. I didn't
mind that much, batch files were all I knew. One day
I decided to create a artificial life form program
out of batch files. I worked on it for about 2 days and then
gave up. I needed a program that I could give a number and
it would give me a random DOS errorlevel in return. Since
I didn't have access to BBS's yet and wasn't that
knowledgeable about how to obtain programs, I stopped the
'project' and got on with my other projects.
Well I finally started to learn C++. Now that I can actually
program, I decided to create that program I had wanted for over
a year. This is really my first programming attempt and I'm
quite pleased with it. I decided to release it to the BBS
community because as a SysOp (which I am), I found a lot of
potential uses for it, which I will get to later...
For now, I will explain how to use the RANDOM program. I made it
very easy to use, one command line argument is all that's
necessary.
Operation:
First I will explain how Random works, you give it a number (1
to 255) and it will randomize it and return a DOS errorlevel of
the number it chooses.
Example:
RANDOM.EXE 100
In the example above, RANDOM would pick a number between 1 and 100
and exit with that errorlevel.
Here's how you could use it in a batch file to pick a Random
program to run:
@ECHO OFF
RANDOM 5
IF ERRORLEVEL 5 GOTO RUN5
IF ERRORLEVEL 4 GOTO RUN4
IF ERRORLEVEL 3 GOTO RUN3
IF ERRORLEVEL 2 GOTO RUN2
IF ERRORLEVEL 1 GOTO RUN1
IF ERRORLEVEL 0 GOTO ERROR
:RUN5
CD\FUN
FUN.EXE
Etc.....
Note that Random will not exit will an errorlevel zero, in less
you give an improper command line.
Other Uses:
Random has a number of other uses. I have a menu program that
has a color file. Well I have RANDOM pick a new color every time
it loads. For SysOp's there's many different uses. In a nightly
event batch file you could have RANDOM change the display files
(ie. Menus, Hello Screens), you could have a 'Random Door' on your
board. The random door would pick a random door for the user to
play. That way the users will play games that they have never
played before. I have included a batch file (DOOR10.BAT) for a
WildCat BBS, to give an example how you can do this. If you have
found a interesting use for it, please leave me a message. You
can reach me the following ways:
VideoGame Horizons Online
(602) 282-3134 1:114/304
WildNet, TeenNet, AzNet, and FidoNet
AzNet address: 66:145/1
FidoNet address: 1:114/304
One last note, this program is distributed as FreeWare.
If you use it often, please leave me a message and let me know
that you like it.
Signed,
Jaben Cargman